﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using DC2010.Objects;
using Xna.Base;
using DC2010.Objects.Data;
using Microsoft.Xna.Framework;
using RolePlaying;

namespace DC2010
{
    public partial class Hud
    {

        private void DrawInventory()
        {
            SpriteBatch spriteBatch = screenManager.SpriteBatch;

            // vyberme CI inventar chceme zobrazovat.
            CreatureData selectedMember = Root.I.GameSystem.SelectedMember;
            if (selectedMember == null) selectedMember = Root.I.GameSystem.Party.L.GetLeader();

            if ((Root.I.GameSystem.CurrentScreen == "Inventory") && (selectedMember != null))
            {
                spriteBatch.Draw(TM.GetTex("Interface/Inventory"), RM.Get("Inventory").rect, Color.White);

                //inventory can display 30 items.
                for (int i = 0; i < 30; i++)
                {
                    ItemData itm = selectedMember.Inventory.GetItemAtPosition((CarryLocations)i).GetItemDataFromCode();

                    //display magic itemsquare
                    if (itm != null)
                    {
                        if (itm.Effects.Count > 0)
                            spriteBatch.Draw(TM.GetTex("Interface/Box/BoxAqua"), RM.Get("Inventory_" + i).GetVector(), Color.White);

                        // draw item
                        TM.GetAnimation(itm.Gfx.Icon.Texture).Draw(spriteBatch, RM.Get("Inventory_" + i).GetVector() + new Vector2(2, 2), 0f);
                    }
                }


                //Health, Stamina, Mana
                spriteBatch.DrawString(Fonts.DebugFont, "HEALTH " + selectedMember.Attributes.Health.ToString(), RM.Get("Inventory").GetVector() + new Vector2(5 + 1, 250 + 1), Color.Red);
                spriteBatch.DrawString(Fonts.DebugFont, "STAMINA " + selectedMember.Attributes.Stamina.ToString(), RM.Get("Inventory").GetVector() + new Vector2(5 + 1, 268 + 1), Color.Yellow);
                spriteBatch.DrawString(Fonts.DebugFont, "MANA " + selectedMember.Attributes.Mana.ToString(), RM.Get("Inventory").GetVector() + new Vector2(5 + 1, 286 + 1), Color.Blue);
            }
        }

    }
}
